package com.example.components;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.nio.file.StandardWatchEventKinds;
import java.util.ArrayList;

public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
	//记录一下Viewpager中的页面的数量
	private final int number;


	//构造方法
	public MyFragmentPagerAdapter(FragmentManager fm,int number){
		super(fm,FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
		this.number=number;
	}

	@Override
	public Fragment getItem(int position) {
		if(position==0){
			CheckBoxFragment checkBoxFragment = new CheckBoxFragment();
			return checkBoxFragment;
		}
		return null;
	}

	@Override
	public int getCount() {
		return this.number;
	}
}
